<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <title>618钜惠</title>
    <link rel="stylesheet" href="./css/reset.css" />
    <style>
      body {
        line-height: 0;
        background: #bb1c28;
      }
      .img {
        width: 100%;
      }
      .img-float {
        width: 24.3vw;
        position: fixed;
        z-index: 11;
        bottom: 40vw;
        right: 4vw;
      }
      .page-container {
        position: relative;
      }
      input {
        border: none;
        outline: none;
        position: absolute;
        z-index: 10;
        width: 86vw;
        height: 11vw;
        left: 7vw;
        bottom: 27.4vw;
        background: #ffffff;
        font-size: 4vw;
        color: #333333;
        line-height: 11vw;
        text-align: center;
      }
      input::placeholder {
        color: #666666;
      }
      .button {
        position: absolute;
        z-index: 10;
        width: 41vw;
        height: 10vw;
        left: 29vw;
        bottom: 12.3vw;
      }
      .toast {
        position: fixed;
        top: 30%;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 5vw 6vw; /* 20px 50px */
        border-radius: 1.3333vw; /* 10px */
        font-size: 4vw; /* 30px */
        z-index: 9999;
        animation: fadeInOut 3s ease-in-out;
      }
    </style>
  </head>
  <body>
    <div class="page-container">
      <img src="./images/1-1.jpg" class="img" />
      <img src="./images/1-2.jpg" class="img" />
      <img src="./images/1-3.jpg" class="img" />
      <img src="./images/1-4.jpg" class="img" />
      <img src="./images/1-5.jpg" class="img" />
      <img src="./images/1-6.jpg" class="img" />
      <img src="./images/1-7.jpg" class="img" />
      <img src="./images/1-8.jpg" class="img" />
      <img src="./images/1-9.jpg" class="img" />
      <img src="./images/2-1.jpg" class="img" />
      <img src="./images/2-2.jpg" class="img" />
      <img src="./images/2-3.jpg" class="img" />
      <img src="./images/2-4.jpg" class="img" />
      <img src="./images/2-5.jpg" class="img" />
      <img src="./images/2-6.png" class="img" />
      <img src="./images/float.png" class="img-float" />
      <div class="form">
        <input
          id="inputPhone"
          type="text"
          name="phone"
          placeholder="请输入联系电话"
        />
        <div class="button" onclick="submit()"></div>
      </div>
    </div>
    <!-- toast -->
    <div id="toast" class="toast" hidden></div>
    <script src="./js/jquery-3.2.1.min.js"></script>
    <script>
      function submit() {
        if ($("#inputPhone").val().trim().length === 0) {
          showToast("请输入联系电话");
          return false;
        }
        showToast("提交成功！");
      }
      function showToast(message) {
        const toast = document.getElementById("toast");
        toast.textContent = message;
        toast.hidden = false;
        setTimeout(() => {
          toast.hidden = true;
        }, 3000);
      }
    </script>
  </body>
</html>
